package com.lxk.weixin;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;
import java.util.UUID;

/**
 * @author JohnSoybean
 * @create 2020/3/31 10:34
 * @description
 */
public class MyWxPayUtil {

    /**
     * AppID 微信号唯一标识
     */
    public final static String appid = "wx3e07e0cdba5afe49";

    /**
     * AppSecret 第三方用户唯一凭证密钥
     */
    public final static String mchid = "1580821911";

    /**
     * 支付key
     */
    public final static String key = "QIANJIA1JU2J3B4HY5HM3MG2FD4F2GGT";

    /**
     * WeChat退款回调地址
     */
    public final static String notify_url = "http://b.qjbdsh.com/wxpay/afterrefund";


    /**
     * -获取10位随机数
     * @return nonceStr
     */
    public static String getNonceStr(){
        return UUID.randomUUID().toString().replace("-","").substring(0, 10);
    }

    /**
     * -根据时间随机生成退款订单号
     * @return outRefundNo
     */
    public static String getOutRefundNo() {
        Random rand = new Random();
        int shu2 = rand.nextInt(8999)+1000;
        DateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        String shu1 = format.format(new Date());
        String shu0 = "RF";
        String randId = shu0 + shu1 + shu2;
        return randId;
    }
//    #parameters.put("out_trade_no", data.getTransaction_id());
//    #parameters.put("out_refund_no", data.getOut_refund_no());
//    #parameters.put("total_fee", String.valueOf(data.getTotal_fee()));
//    #parameters.put("refund_fee", String.valueOf(data.getRefund_fee()));





}
